﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace StudentsForm
{
    public partial class Students : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Register_Click(object sender, EventArgs e)
        {
            string firstName = this.FirstName.Text;
            string lastName = this.LastName.Text;
            string facultyNumber = this.FacultyNumber.Text;
            string university = this.University.SelectedItem.Text;
            string specialty = this.Specialty.SelectedItem.Text;
            string course = this.Courses.SelectedItem.Text;

            this.Controls.Add(new LiteralControl("<p>" + Server.HtmlEncode(firstName) + "</p>"));
            this.Controls.Add(new LiteralControl("<p>" + Server.HtmlEncode(lastName) + "</p>"));
            this.Controls.Add(new LiteralControl("<p>" + Server.HtmlEncode(facultyNumber) + "</p>"));
            this.Controls.Add(new LiteralControl("<p>" + Server.HtmlEncode(university) + "</p>"));
            this.Controls.Add(new LiteralControl("<p>" + Server.HtmlEncode(specialty) + "</p>"));
            this.Controls.Add(new LiteralControl("<p>" + Server.HtmlEncode(course) + "</p>"));
        }
    }
}